home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / www / src / midaswww-1.0 / TreeP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-16  |  3.4 KB  |  113 lines

  1. /*
  2.  * $XConsortium: TreeP.h,v 1.13 90/04/13 16:39:54 jim Exp $
  3.  *
  4.  * Copyright 1990 Massachusetts Institute of Technology
  5.  * Copyright 1989 Prentice Hall
  6.  *
  7.  * Permission to use, copy, modify, and distribute this software for any
  8.  * purpose and without fee is hereby granted, provided that the above
  9.  * copyright notice appear in all copies and that both the copyright notice
  10.  * and this permission notice appear in supporting documentation.
  11.  * 
  12.  * M.I.T., Prentice Hall and the authors disclaim all warranties with regard
  13.  * to this software, including all implied warranties of merchantability and
  14.  * fitness.  In no event shall M.I.T., Prentice Hall or the authors be liable
  15.  * for any special, indirect or cosequential damages or any damages whatsoever
  16.  * resulting from loss of use, data or profits, whether in an action of
  17.  * contract, negligence or other tortious action, arising out of or in
  18.  * connection with the use or performance of this software.
  19.  * 
  20.  * Authors:  Jim Fulton, MIT X Consortium,
  21.  *           based on a version by Douglas Young, Prentice Hall
  22.  * 
  23.  * This widget is based on the Tree widget described on pages 397-419 of
  24.  * Douglas Young's book "The X Window System, Programming and Applications 
  25.  * with Xt OSF/Motif Edition."  The layout code has been rewritten to use
  26.  * additional blank space to make the structure of the graph easier to see
  27.  * as well as to support vertical trees.
  28.  */
  29.  
  30.  
  31. #ifndef _XawTreeP_h
  32. #define _XawTreeP_h
  33.  
  34. #include "Tree.h"
  35. #ifdef MOTIF
  36. #include <Xm/XmP.h>
  37. #endif
  38.  
  39. typedef struct _TreeClassPart {
  40.     int ignore;
  41. } TreeClassPart;
  42.  
  43. typedef struct _TreeClassRec {
  44.     CoreClassPart core_class;
  45.     CompositeClassPart composite_class;
  46.     ConstraintClassPart constraint_class;
  47.     TreeClassPart tree_class;
  48. } TreeClassRec;
  49.  
  50. extern TreeClassRec treeClassRec;
  51.  
  52. typedef struct {
  53.     /* fields available through resources */
  54.     Dimension hpad;            /* hSpace/HSpace */
  55.     Dimension vpad;            /* vSpace/VSpace */
  56.     Dimension line_width;        /* lineWidth/LineWidth */
  57.     Pixel foreground;            /* foreground/Foreground */
  58.     XtGravity gravity;            /* gravity/Gravity */
  59.     Boolean auto_reconfigure;        /* autoReconfigure/AutoReconfigure */
  60.     /* private fields */
  61.     GC gc;                /* used to draw lines */
  62.     Widget tree_root;            /* hidden root off all children */
  63.     Dimension *largest;            /* list of largest per depth */
  64.     int n_largest;            /* number of elements in largest */
  65.     Dimension maxwidth, maxheight;    /* for shrink wrapping */
  66. } TreePart;
  67.  
  68.  
  69. typedef struct _TreeRec {
  70.     CorePart core;
  71.     CompositePart composite;
  72.     ConstraintPart constraint;
  73.     TreePart tree;
  74. }  TreeRec;
  75.  
  76.  
  77. /*
  78.  * structure attached to all children
  79.  */
  80. typedef struct _TreeConstraintsPart {
  81.     /* resources */
  82.     Widget parent;            /* treeParent/TreeParent */
  83.     GC gc;                /* treeGC/TreeGC */
  84.     /* private data */
  85.     Widget *children;
  86.     int n_children;
  87.     int max_children;
  88.     Dimension bbsubwidth, bbsubheight;    /* bounding box of sub tree */
  89.     Dimension bbwidth, bbheight;    /* bounding box including node */
  90.     Position x, y;
  91. } TreeConstraintsPart;
  92.  
  93. typedef struct _TreeConstraintsRec {
  94.    TreeConstraintsPart tree;
  95. } TreeConstraintsRec, *TreeConstraints;
  96.  
  97.  
  98. /*
  99.  * useful macros
  100.  */
  101.  
  102. #define TREE_CONSTRAINT(w) \
  103.                    ((TreeConstraints)((w)->core.constraints))
  104.  
  105. #define TREE_INITIAL_DEPTH 10        /* for allocating largest array */
  106. #define TREE_HORIZONTAL_DEFAULT_SPACING 20
  107. #define TREE_VERTICAL_DEFAULT_SPACING 6
  108.  
  109. #endif /* _XawTreeP_h */
  110.  
  111.  
  112.  
  113.